Skip to content

fix(compose): dependency closure for restricted plans, carry namespace modes - #118

Merged
bilby91 merged 2 commits into
mainfrom
fix/native-compose-namespace-modes-and-closure
Aug 23, 2026
Merged

fix(compose): dependency closure for restricted plans, carry namespace modes#118
bilby91 merged 2 commits into
mainfrom
fix/native-compose-namespace-modes-and-closure

Conversation

@bilby91

@bilby91 bilby91 commented Aug 23, 2026

Copy link
Copy Markdown
Member

Follow-up to #115 — the two MEDIUM findings from round 2 of the adversarial review on crunchloop/dap#4828.

1. Restricted plans now start/build the dependency closure

docker compose up <names...> starts the named services and their transitive dependencies; a Plan restricted via Services (devcontainer runServices) started exactly the named set, so a dependency outside the list was neither built nor started. New compose.ServiceClosure expands the selection through the same edge set TopoSort orders by (depends_on + service:<x> namespace references, now including pid:/ipc:), and both makeKeepSet and the engine's sidecar-image builds use it.

2. network_mode/pid/ipc carried to the backend

serviceToRunSpec always attached the project network and the runtime-neutral spec had no namespace fields — so network_mode: none (an explicit isolation request) silently received full project-network connectivity, and service:<x> namespace joins were dropped. Now:

  • RunSpec gains NetworkMode/PidMode/IpcMode (Docker HostConfig syntax); the docker backend maps them onto HostConfig.
  • service:<x> resolves to the dependency's already-started container ID — ordering was already guaranteed because those references are TopoSort edges; pid:/ipc: service references now contribute edges too.
  • A service with a network mode is not attached to the project network (Docker rejects the combination), matching docker compose semantics.
  • Backends without namespace sharing are untouched: Plan.Validate already refuses such projects via Capabilities.NamespaceSharing.

Tests

  • Closure: restricted Up starts dependencies and nothing else; ServiceClosure follows namespace edges; engine sidecar builds cover dependencies of the selection.
  • Modes: none/host carried and project network skipped; service:<x> resolves to the dependency's container ID; unaffected services keep the project network.
  • go test ., ./compose, ./runtime/docker green.

Will be consumed by crunchloop/dap#4828 as v0.4.2.

🤖 Generated with Claude Code

…e modes

Round-2 adversarial findings on the native backend switch in dap:

1. A Plan restricted to a service subset (devcontainer runServices)
   started exactly the named services — docker compose up <names...>
   starts their transitive dependency closure. makeKeepSet and the
   engine's sidecar-image builds now expand the selection through the
   new compose.ServiceClosure (depends_on plus service:<x> namespace
   edges, the same edge set TopoSort orders by), so a dependency
   outside runServices is built and started again.

2. network_mode/pid/ipc were silently dropped: serviceToRunSpec always
   attached the project network and the runtime spec had no namespace
   fields, so `network_mode: none` — an explicit isolation request —
   received full project-network connectivity. RunSpec gains
   NetworkMode/PidMode/IpcMode (Docker HostConfig syntax), the docker
   backend maps them, service:<x> resolves to the dependency's started
   container ID, and a service with a network mode skips the project
   network per Docker's API constraints. TopoSort now also treats
   pid:/ipc: service references as ordering edges.

Backends without namespace sharing are unaffected: Plan.Validate
already refuses these projects via Capabilities.NamespaceSharing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 40 minutes

Limit details: You’ve used the included review currently available. Your 67 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

You’re in a promotional period — use the checkbox below to run this review for free:

  • Run review for free

On-demand reviews are free for the next 29 days. After that, they cost $0.25 per reviewed file.

How can I continue?

Run this review now using the option above, or comment @coderabbitai review --use-credits.

You can also wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa9a169b-fa21-4d93-8929-7d96c1ae5c67

📥 Commits

Reviewing files that changed from the base of the PR and between 0f0d1a8 and 9a4419b.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • compose/graph.go
  • compose/orchestrator.go
  • compose/orchestrator_test.go
  • runtime/docker/run.go
  • runtime/runtime.go
  • up.go
  • up_compose_sidecar_test.go

Comment @coderabbitai help to get the list of available commands.

@bilby91
bilby91 merged commit bc80e46 into main Aug 23, 2026
19 checks passed
@bilby91
bilby91 deleted the fix/native-compose-namespace-modes-and-closure branch August 23, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant